﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace BankOCR
{
    class MainProgram
    {
        static string inputFilePath = "";

        static void Main(string[] args)
        {
            if (!VerifyParameters(args))
                return;

            var parser = new Parser();

            foreach (var line in parser.Parse(File.ReadAllLines(inputFilePath)))
                Console.WriteLine(line);

            Console.ReadKey();
        }

        static bool VerifyParameters(string[] args)
        {
            inputFilePath = args.Length >= 2 ? args[1] : "Input.txt";
            Console.WriteLine("Using input file " + inputFilePath);
            Console.WriteLine();

            if (!File.Exists(inputFilePath)) {
                Console.WriteLine("Provided input file " + inputFilePath + " does not exist.");
                Console.ReadKey();
                return false;
            }

            return true;
        }
    }
}
